
import {
  showToast,
  showLoading,
  hideLoading,
  showModal
} from '@tarojs/taro'
// import errorIcon from "../assets/login_room_icon.png"
export function warning(text,long=1500) {
  showToast({
    title: text,
    duration: long,
    icon: 'none',
    mask: false,
  })
}
export function failsTip(text,long=300000) {
  showToast({
    title: text,
    icon: 'error',
    duration: long,
    mask: true,
  })
  // showToast({
  //   title: text,
  //   // icon: 'none',
  //   image:errorIcon,
  //   // '/assets/error_icon.png',
  //   duration: long,
  //   mask: true,
  // })
}
export function successTip(text,long=3000) {
  showToast({
    title: text,
    icon: 'success',
    duration: long,
    mask: true,
  })
}
export function loading(text='加载中') {
  showLoading({
    title: text,
    mask: true,
  })
}
export function closeLoading() {
    hideLoading()
}
export function tipsModal(content,title='提示') {
  showModal({
    title: title,
    content: content,
    confirmColor:'#12A5FF',
    cancelColor:'#333',
    showCancel:false
  })
}
